\(\int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx\) [289]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 59 \[ \int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\log (\cos (c+d x))}{a d}-\frac {\left (a^2-b^2\right ) \log (a+b \sec (c+d x))}{a b^2 d}+\frac {\sec (c+d x)}{b d} \]

[Out]

ln(cos(d*x+c))/a/d-(a^2-b^2)*ln(a+b*sec(d*x+c))/a/b^2/d+sec(d*x+c)/b/d

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3970, 908} \[ \int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {\left (a^2-b^2\right ) \log (a+b \sec (c+d x))}{a b^2 d}+\frac {\log (\cos (c+d x))}{a d}+\frac {\sec (c+d x)}{b d} \]

[In]

Int[Tan[c + d*x]^3/(a + b*Sec[c + d*x]),x]

[Out]

Log[Cos[c + d*x]]/(a*d) - ((a^2 - b^2)*Log[a + b*Sec[c + d*x]])/(a*b^2*d) + Sec[c + d*x]/(b*d)

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 3970

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[-(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[(b^2 - x^2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {b^2-x^2}{x (a+x)} \, dx,x,b \sec (c+d x)\right )}{b^2 d} \\ & = -\frac {\text {Subst}\left (\int \left (-1+\frac {b^2}{a x}+\frac {a^2-b^2}{a (a+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{b^2 d} \\ & = \frac {\log (\cos (c+d x))}{a d}-\frac {\left (a^2-b^2\right ) \log (a+b \sec (c+d x))}{a b^2 d}+\frac {\sec (c+d x)}{b d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.88 \[ \int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {b^2 \log (\cos (c+d x))+\left (-a^2+b^2\right ) \log (a+b \sec (c+d x))+a b \sec (c+d x)}{a b^2 d} \]

[In]

Integrate[Tan[c + d*x]^3/(a + b*Sec[c + d*x]),x]

[Out]

(b^2*Log[Cos[c + d*x]] + (-a^2 + b^2)*Log[a + b*Sec[c + d*x]] + a*b*Sec[c + d*x])/(a*b^2*d)

Maple [A] (verified)

Time = 0.72 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.97

method result size
derivativedivides \(\frac {\frac {a \ln \left (\cos \left (d x +c \right )\right )}{b^{2}}+\frac {1}{b \cos \left (d x +c \right )}+\frac {\left (-a^{2}+b^{2}\right ) \ln \left (b +a \cos \left (d x +c \right )\right )}{b^{2} a}}{d}\) \(57\)
default \(\frac {\frac {a \ln \left (\cos \left (d x +c \right )\right )}{b^{2}}+\frac {1}{b \cos \left (d x +c \right )}+\frac {\left (-a^{2}+b^{2}\right ) \ln \left (b +a \cos \left (d x +c \right )\right )}{b^{2} a}}{d}\) \(57\)
risch \(-\frac {i x}{a}-\frac {2 i c}{a d}+\frac {2 \,{\mathrm e}^{i \left (d x +c \right )}}{d b \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{b^{2} d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{a d}+\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{2} d}\) \(139\)

[In]

int(tan(d*x+c)^3/(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(1/b^2*a*ln(cos(d*x+c))+1/b/cos(d*x+c)+(-a^2+b^2)/b^2/a*ln(b+a*cos(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.17 \[ \int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {a^{2} \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right ) \log \left (a \cos \left (d x + c\right ) + b\right ) + a b}{a b^{2} d \cos \left (d x + c\right )} \]

[In]

integrate(tan(d*x+c)^3/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

(a^2*cos(d*x + c)*log(-cos(d*x + c)) - (a^2 - b^2)*cos(d*x + c)*log(a*cos(d*x + c) + b) + a*b)/(a*b^2*d*cos(d*
x + c))

Sympy [F]

\[ \int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\int \frac {\tan ^{3}{\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \]

[In]

integrate(tan(d*x+c)**3/(a+b*sec(d*x+c)),x)

[Out]

Integral(tan(c + d*x)**3/(a + b*sec(c + d*x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.97 \[ \int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\frac {a \log \left (\cos \left (d x + c\right )\right )}{b^{2}} - \frac {{\left (a^{2} - b^{2}\right )} \log \left (a \cos \left (d x + c\right ) + b\right )}{a b^{2}} + \frac {1}{b \cos \left (d x + c\right )}}{d} \]

[In]

integrate(tan(d*x+c)^3/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

(a*log(cos(d*x + c))/b^2 - (a^2 - b^2)*log(a*cos(d*x + c) + b)/(a*b^2) + 1/(b*cos(d*x + c)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 289 vs. \(2 (59) = 118\).

Time = 0.61 (sec) , antiderivative size = 289, normalized size of antiderivative = 4.90 \[ \int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {\frac {a \log \left ({\left | a + b - \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} \right |}\right )}{b^{2}} - \frac {2 \, a \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right )}{b^{2}} - \frac {{\left (a^{2} - 2 \, b^{2}\right )} \log \left (\frac {{\left | 2 \, b + \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - 2 \, {\left | a \right |} \right |}}{{\left | 2 \, b + \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + 2 \, {\left | a \right |} \right |}}\right )}{b^{2} {\left | a \right |}} + \frac {2 \, {\left (a - 2 \, b + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}}{b^{2} {\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}}}{2 \, d} \]

[In]

integrate(tan(d*x+c)^3/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

-1/2*(a*log(abs(a + b - 2*b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - a*(cos(d*x + c) - 1)^2/(cos(d*x + c) + 1)^
2 + b*(cos(d*x + c) - 1)^2/(cos(d*x + c) + 1)^2))/b^2 - 2*a*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 1
))/b^2 - (a^2 - 2*b^2)*log(abs(2*b + 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*b*(cos(d*x + c) - 1)/(cos(d
*x + c) + 1) - 2*abs(a))/abs(2*b + 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*b*(cos(d*x + c) - 1)/(cos(d*x
 + c) + 1) + 2*abs(a)))/(b^2*abs(a)) + 2*(a - 2*b + a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1))/(b^2*((cos(d*x +
c) - 1)/(cos(d*x + c) + 1) + 1)))/d

Mupad [B] (verification not implemented)

Time = 14.91 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.95 \[ \int \frac {\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {a\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}{b^2\,d}-\frac {2}{b\,d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{a\,d}-\frac {\ln \left (a+b-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )\,\left (\frac {a}{b^2}-\frac {1}{a}\right )}{d} \]

[In]

int(tan(c + d*x)^3/(a + b/cos(c + d*x)),x)

[Out]

(a*log(tan(c/2 + (d*x)/2)^2 - 1))/(b^2*d) - 2/(b*d*(tan(c/2 + (d*x)/2)^2 - 1)) - log(tan(c/2 + (d*x)/2)^2 + 1)
/(a*d) - (log(a + b - a*tan(c/2 + (d*x)/2)^2 + b*tan(c/2 + (d*x)/2)^2)*(a/b^2 - 1/a))/d